package com.bestbuy.pojo;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

/**
 * @author ThanhNgo
 * 
 */
@Entity
@Table(name = "account_role")
public class AccountRole implements Serializable {

	@Id
	@Column(name = "IDACCOUNT_ROLE")
	private Integer idaccountRole;
	
	@Column(name = "TYPE")
    private String role;
	
	@OneToMany(mappedBy="accountRole", fetch = FetchType.LAZY)
    private Set<Account> accounts = new HashSet<Account>(0);

	public AccountRole() {
		super();
		// TODO Auto-generated constructor stub
	}

	public AccountRole(Integer idaccountRole, String role, Set<Account> accounts) {
		super();
		this.idaccountRole = idaccountRole;
		this.role = role;
		this.accounts = accounts;
	}

	public Integer getIdaccountRole() {
		return idaccountRole;
	}

	public void setIdaccountRole(Integer idaccountRole) {
		this.idaccountRole = idaccountRole;
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	public Set<Account> getAccounts() {
		return accounts;
	}

	public void setAccounts(Set<Account> accounts) {
		this.accounts = accounts;
	}

	
}
